﻿@using EUTmvc.Helpers
@model IEnumerable<EUTmvc.Models.Admin.AdminAccountIndexAction>

<div class="panel panel-default">
    <div class="panel-heading">
        <strong>Danh sách tài khoản</strong>
    </div>
    <div class="panel-body">
       <div class="table-responsive">
          <table class="table table-striped table-bordered table-hover" id="dataTables-example">
              <thead>
            <tr>
                <th>STT</th>
                    <th>@Html.DisplayNameFor(model => model.Account)</th>
                    <th>@Html.DisplayNameFor(model => model.NamePerson)</th>
                    <th>@Html.DisplayNameFor(model => model.NameGroupAccount)</th>
                    <th>@Html.DisplayNameFor(model => model.Description)</th>
                    <th>
                            <a href="@Url.Action("New", "AdminAccountAction")" data-modal="" class="btn btn-primary pull-right"><span class='glyphicon glyphicon-plus'></span></a>
                    </th>
             </tr>
                  </thead>
              <tbody>
           @{int i = 0;}
            @foreach (var item in Model)
            {
                i++;
                <tr>
                   <td>
                        @i
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Account)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.NamePerson)
                    </td>
                        <td>
                        @Html.DisplayFor(modelItem => item.NameGroupAccount)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Description)
                    </td>
                    <td>
                        <div class="pull-right">
                            <a href="@Url.Action("Edit", "AdminAccountAction", new { account = item.Account })" data-modal="" class="btn btn-default"><span class='glyphicon glyphicon-pencil'></span></a>&nbsp;
                            <a href="@Url.Action("SetPassword", "AdminAccountAction", new { account = item.Account })" data-modal="" class="btn btn-default"><span class='glyphicon glyphicon-search'></span></a>&nbsp;
                            <a href="@Url.Action("Delete", "AdminAccountAction", new { account = item.Account })" data-modal="" class="btn btn-danger"><span class='glyphicon glyphicon-trash'></span></a>&nbsp;
                        </div>
                    </td>
                </tr>
            }
           </tbody>
        </table>
          </div>
    </div>
</div>
@Scripts.Render("~/bundles/modalform")
        <script src="@Url.Content("/Scripts/plugins/dataTables/jquery.dataTables.js")"></script>
        <script src="@Url.Content("/Scripts/plugins/dataTables/dataTables.bootstrap.js")"></script>
        <script>
            $(document).ready(function () {
                $('#dataTables-example').dataTable();
            });
    </script>

